package com.jay.beiange.efccp;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jay.beiange.efccp.view.HomeMenu;
import com.jay.beiange.efccp.view.LoopPicture;

/**
 * Created by Administrator on 2016/12/24 0024.
 */

public class MainFragment extends Fragment {
    private LoopPicture loopPicture;
    private HomeMenu mHomeMenu;
    private View view;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_main, container, false);

        initView();
        initBanner();
        return view;

    }

    private void initBanner() {
        int[] imagesRes = {R.mipmap.a, R.mipmap.b, R.mipmap.c,
                R.mipmap.d};
        loopPicture.setImageRes(imagesRes, true);
        String[] titles = {"111111111111111111", "2222222222222222",
                "3333333333333", "4444444444444", "5555555555"};
        loopPicture.setImageTitle(titles);
    }

    private void initView() {

        loopPicture = (LoopPicture) view.findViewById(R.id.loopPicture);
        mHomeMenu = (HomeMenu) view.findViewById(R.id.id_home_menu);

    }


}
